import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 */
public class Test4 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String[] strs = new String[3];
        for (int i = 0; i < 3; i++) {
            strs[i] = sc.nextLine();
        }
        int num1 = 0;
        int num2 = 0;
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < strs[i].length(); j++) {
                if(strs[i].charAt(j) != ' '
                        && (j + 1 >= strs[i].length() || strs[i].charAt(j + 1) == ' ')) {
                    num1++;
                }
                if(strs[i].charAt(j) == ' ') {
                    num2++;
                }
            }
        }
        System.out.println(num1 + " " + num2);
    }
}
